﻿using System.ComponentModel.DataAnnotations;

namespace aspNetCURD.Models
{
    public class course
    {
        /// <summary>
        /// 课程号
        /// </summary>
        [Key]
        [Required(ErrorMessage = "课程号不能为空")]
        [MaxLength(4, ErrorMessage = "课程号最大长度为 4")]
        public string cno { get; set; }
        /// <summary>
        /// 课程名称
        /// </summary>
        [Required(ErrorMessage = "课程名不能为空")]
        [MaxLength(20, ErrorMessage = "课程名最大长度为 20")]
        public string cname { get; set; }
        /// <summary>
        /// 课时
        /// </summary>
        public byte? classhour { get; set; }
        /// <summary>
        /// 学分
        /// </summary>
        public byte? credit { get; set; }
    }
}
